import 'package:flutter/material.dart';

import 'package:state_flutter/components/NavBar/navbar.dart';

class CardPage extends StatelessWidget{
  final arguments;
  CardPage({Key key, this.arguments}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: NavBar({
        'leading': false,
        'title': 'CardPage'
      }),
      body: MyCard(arguments: this.arguments),
    );
  }
}

class MyCard extends StatefulWidget {
  final arguments;
  MyCard({Key key, this.arguments}) : super(key: key);

  @override
  _MyCardState createState() => _MyCardState();
}

class _MyCardState extends State<MyCard> {
  @override
  Widget build(BuildContext context) {
    return ListView(
      children: <Widget>[
        Card(
          margin: EdgeInsets.all(10),
          child: Column(
            children: <Widget>[
              AspectRatio(
                aspectRatio: 5/2,
                child: Image.network(
                  "https://c-ssl.duitang.com/uploads/item/201711/26/20171126195857_MtFYk.thumb.700_0.jpeg",
                  fit: BoxFit.cover
                ),
              ),
              ListTile(
                leading: CircleAvatar(
                  backgroundImage: AssetImage("lib/common/images/2.0x/01.jpg"),
                ),
                title: Text('title'),
                subtitle: Text('subtitle'),
              )
            ],
          ),
        ),
      ],
    );
  }
}